package com.tarena.lbs.coupon.utils;

/**
 * @className: MyResult
 * @author: Feng-hongliang
 * @date: 2025/10/14 10:22
 * @Version: 1.0
 * @description: 临时使用一个result，自带的使用有问题
 */

public class MyResult <T> {

//    private Integer code;
    /**
     * 响应结果
     */
    private Boolean result;
    /**
     * 响应信息
     */
    private String message;
    /**
     * 响应数据
     */
    private T data;

    public MyResult(Boolean result, String message, T data) {
        this.result = result;
        this.message = message;
        this.data = data;
    }

    public static MyResult<String> success() {
        return new MyResult<>(true, "success", null);
    }

    public static MyResult<String> fail(String message) {
        return new MyResult<>(false, message, null);
    }


    public Boolean getResult() {
        return result;
    }

    public void setResult(Boolean result) {
        this.result = result;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
